package com.laibatour.generator;

import com.laibatour.generator.code.GeneratorCode;
import org.apache.velocity.util.StringUtils;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

/**
 * Created by guan on 2016/2/23.
 */
public class Main {
    public static void main(String[] args) {
        String tablename = null;
        BufferedReader strin = new BufferedReader(new InputStreamReader(System.in));

        while (true) {
            System.out.println("请输入数据库表名");
            try {
                tablename = strin.readLine();
            } catch (IOException e2) {
                e2.printStackTrace();
            }
            if ("q".equals(tablename) || "quit".equals(tablename) || "exit".equals(tablename)) {
                return;
            }
            GeneratorCode.gen(tablename);


            System.out.println("代码已生成....\n");
        }

    }
}
